﻿using LxCore;
using LxCore.Samples;
using System.Collections.ObjectModel;

namespace LxCFD
{
    public partial class SamplesWindowVM : BindableBase
    {
        public SamplesWindowVM(SampleWindow sampleWindow)
        {
            this.SampleWindow = sampleWindow;
            RunSample = new DelegateCommand(runSample);
            SelSampleVM = Samples[0];
        }
        private SampleWindow SampleWindow;
        public ObservableCollection<SampleVMBase> Samples { get; set; } = new ObservableCollection<SampleVMBase>()
        {
            new SolidCuboidHeatConduction(),
            new TwoCuboidHeatConduction(),
            new TransientHeatConduction(),
            new AnistrophyHeatConduction(),
            new CavityFlow(),
            new LaminarNaturalConvection(),
            new BallRadiation(),
            new SolidCuboidTransientConduction(),
            new FlowAroundCylinder(),
            new CylinderNaturalConvection(),
        };
        private SampleVMBase _SelSampleVM;
        public SampleVMBase SelSampleVM
        {
            get { return _SelSampleVM; }
            set { _SelSampleVM = value; RaisePropertyChanged(nameof(SelSampleVM)); }
        }
        public DelegateCommand RunSample { get; set; }
        private void runSample()
        {
            SampleWindow.Close();
            SelSampleVM.RunCase();
            //LxSim.Sim.CalcManage.RunSimulation();
        }

    }
}
